<template>
    <div class="create-activity">
        <div class="head-box">
            <div class="icon" @click="backFun">
                <i class="el-icon-arrow-left"></i>
            </div>
            <div class="head-title">创建活动</div>
        </div>
        <div class="create-box">
            <div class="create-left">
                <!-- 预览导航 -->
                <previewOperation ref="previewOperation"></previewOperation>
            </div>
            <div class="create-right">
                <!-- 设置表单 -->
                <activitySettings
                    ref="activitySettings"
                    @backFun="backFun"
                ></activitySettings>
            </div>
        </div>
    </div>
</template>

<script>
import previewOperation from "@/components/interactive/previewOperation";
import activitySettings from "@/components/interactive/activitySettings";

export default {
    props: [],
    components: { previewOperation, activitySettings },
    computed: {},
    data() {
        return {
            page_tab: "",
            cat_id: "",
        };
    },
    created() {},
    mounted() {
        this.page_tab = this.$geturl().page_tab;
        this.cat_id = this.$geturl().cat_id;
    },
    methods: {
        backFun() {
            if (this.page_tab == 1) {
                uni.navigateTo({
                    url: `/pages/interactiveActivity/business-promotion?cat_id=${this.cat_id}`,
                });
            } else {
                uni.navigateTo({
                    url: `/pages/interactiveOrder/my-activities`,
                });
            }
            uni.$emit("reset_tabbar_i",1);
        },
    },
};
</script>

<style lang="scss" scoped >
.create-activity {
    background: #f2f2f2;
    height: 100%;
    .head-box {
        background: #fff;
        padding: 5px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid #ececec;
        .icon {
            font-size: 26px;
            cursor: pointer;
            margin-right: 5px;
        }
        .head-title {
            font-size: 18px;
        }
    }
    .create-box {
        display: flex;
        height: calc(100% - 56px);
        .create-left {
            width: 700px;
            height: 100%;
            border-right: 1px solid #e1e1e1;
        }
        .create-right {
            width: calc(100% - 700px); //50%;
            height: 100%;
        }
    }
}
</style>
